# FROM node:18 as node_builder

# WORKDIR /app

# # 复制 package.json 和 package-lock.json
# COPY . /app
# RUN npm install \
#             &&  npm install --save-dev laravel-echo pusher-js
# RUN echo "Building frontend files..." \
# && npm run build \
# && ls -la /app


FROM shinsenter/frankenphp:latest

LABEL authors="Administrator"


# Install imagick, swoole and xdebug
RUN phpaddmod imagick swoole xdebug

# 安装 Node.js 和 npm
# 首先更新包管理器的缓存和安装必要的包
RUN apk update && apk add --no-cache \
    nodejs \
    nodejs-npm

# 配置淘宝 npm 镜像
RUN npm config set registry https://registry.npm.taobao.org

WORKDIR  /app


# COPY . /app
# COPY --from=node_builder /app/package-lock.json /app/package-lock.json
# COPY --from=node_builder /app/package.json /app/package.json
# COPY --from=node_builder /app/public /app/public
#COPY . /app
## 验证文件是否复制成功
#
#
#RUN ls  \
#    && composer install \
#    &&  php artisan octane:install --server=frankenphp \

#ENTRYPOINT ["php", "artisan", "octane:frankenphp"]






# ENTRYPOINT ["/bin/bash", "-c"]
# CMD ["php artisan octane:install --server=frankenphp && php artisan octane:frankenphp --max-requests=500"]
